package com.example.democrud.employee.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.example.democrud.enums.SexEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @ClassName EmployeeVO
 * @Author Administrator
 * @Date 2020/4/21   9:33
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString
@ApiModel("员工实体")
public class EmployeeVO {

    @JSONField(serializeUsing = ToStringSerializer.class)//log转换成string精度丢失问题
    @ApiModelProperty(value = "员工id" ,notes = "mybatis-plus自动生成")
    private Long employeeId;

    @ApiModelProperty(value = "姓名")
    private String name;

    @ApiModelProperty(value = "性别")
    private SexEnum sex;

    @Min(value = 18,message = "年龄不能小于18岁")
    @ApiModelProperty(value = "年龄",notes = "age>0")
    private Integer age;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "创建时间" ,notes = "由数据库自动管理时间的更新" ,required = false)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间" ,notes = "由数据库自动管理时间的更新" ,required = false)
    private LocalDateTime updateTime;

}
